/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Formularios;

import Atributos.EstagiosTabela;
import Atributos.Professor;
import Atributos.ProfessorDias;
import Metodos.ProfDiscMet;
import Metodos.ProfessorDiasMet;
import Metodos.ProfessorMet;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.JOptionPane;

/**
 *
 * @author Andre
 */
public class aula10 extends javax.swing.JFrame {
    static int i;
ProfDiscMet profdiscmet=new ProfDiscMet();
ProfessorMet profmet=new ProfessorMet();
Professor prof=new Professor();
ProfessorDiasMet profdiasmet=new ProfessorDiasMet();
ProfessorDias profdias=new ProfessorDias();

    /**
     * Creates new form aula10
     */
    public aula10() {
        initComponents();
        BufferedImage image=null;
        File imageFile=new File(".\\src\\Imagens\\logo3.png");
        try {
            image=ImageIO.read(imageFile);
            
        } catch (IOException ex) {
        }
        this.setIconImage(image);
        
         i=0;
        AddNomeProf();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jSeparator1 = new javax.swing.JSeparator();
        buton_adicionar1 = new javax.swing.JLabel();
        jCheckBox1 = new javax.swing.JCheckBox();
        jCheckBox3 = new javax.swing.JCheckBox();
        jCheckBox5 = new javax.swing.JCheckBox();
        jCheckBox7 = new javax.swing.JCheckBox();
        jCheckBox2 = new javax.swing.JCheckBox();
        jCheckBox4 = new javax.swing.JCheckBox();
        jCheckBox6 = new javax.swing.JCheckBox();
        jCheckBox8 = new javax.swing.JCheckBox();
        jCheckBox9 = new javax.swing.JCheckBox();
        jCheckBox10 = new javax.swing.JCheckBox();
        jCheckBox12 = new javax.swing.JCheckBox();
        jCheckBox11 = new javax.swing.JCheckBox();
        jCheckBox13 = new javax.swing.JCheckBox();
        jCheckBox14 = new javax.swing.JCheckBox();
        jCheckBox16 = new javax.swing.JCheckBox();
        jCheckBox15 = new javax.swing.JCheckBox();
        jCheckBox18 = new javax.swing.JCheckBox();
        jCheckBox17 = new javax.swing.JCheckBox();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Decima Aula");

        jPanel1.setBackground(new java.awt.Color(0, 0, 0));
        jPanel1.setLayout(null);

        jSeparator1.setBackground(new java.awt.Color(255, 153, 0));
        jSeparator1.setForeground(new java.awt.Color(0, 0, 0));
        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jPanel1.add(jSeparator1);
        jSeparator1.setBounds(31, 10, 10, 520);

        buton_adicionar1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/voltar.jpg"))); // NOI18N
        buton_adicionar1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        buton_adicionar1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                buton_adicionar1MouseClicked(evt);
            }
        });
        jPanel1.add(buton_adicionar1);
        buton_adicionar1.setBounds(80, 550, 180, 50);

        jCheckBox1.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox1.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox1.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox1.setFocusPainted(false);
        jPanel1.add(jCheckBox1);
        jCheckBox1.setBounds(80, 100, 270, 21);

        jCheckBox3.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox3.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox3.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox3.setFocusPainted(false);
        jPanel1.add(jCheckBox3);
        jCheckBox3.setBounds(80, 150, 270, 21);

        jCheckBox5.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox5.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox5.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox5.setFocusPainted(false);
        jPanel1.add(jCheckBox5);
        jCheckBox5.setBounds(80, 200, 270, 21);

        jCheckBox7.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox7.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox7.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox7.setFocusPainted(false);
        jPanel1.add(jCheckBox7);
        jCheckBox7.setBounds(80, 250, 270, 21);

        jCheckBox2.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox2.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox2.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox2.setFocusPainted(false);
        jPanel1.add(jCheckBox2);
        jCheckBox2.setBounds(370, 100, 280, 21);

        jCheckBox4.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox4.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox4.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox4.setFocusPainted(false);
        jPanel1.add(jCheckBox4);
        jCheckBox4.setBounds(370, 150, 280, 21);

        jCheckBox6.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox6.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox6.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox6.setFocusPainted(false);
        jPanel1.add(jCheckBox6);
        jCheckBox6.setBounds(370, 200, 280, 21);

        jCheckBox8.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox8.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox8.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox8.setFocusPainted(false);
        jPanel1.add(jCheckBox8);
        jCheckBox8.setBounds(370, 250, 280, 21);

        jCheckBox9.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox9.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox9.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox9.setFocusPainted(false);
        jPanel1.add(jCheckBox9);
        jCheckBox9.setBounds(80, 300, 270, 21);

        jCheckBox10.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox10.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox10.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox10.setFocusPainted(false);
        jPanel1.add(jCheckBox10);
        jCheckBox10.setBounds(370, 300, 280, 21);

        jCheckBox12.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox12.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox12.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox12.setFocusPainted(false);
        jPanel1.add(jCheckBox12);
        jCheckBox12.setBounds(370, 350, 280, 21);

        jCheckBox11.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox11.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox11.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox11.setFocusPainted(false);
        jPanel1.add(jCheckBox11);
        jCheckBox11.setBounds(80, 350, 270, 21);

        jCheckBox13.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox13.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox13.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox13.setFocusPainted(false);
        jPanel1.add(jCheckBox13);
        jCheckBox13.setBounds(80, 400, 270, 21);

        jCheckBox14.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox14.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox14.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox14.setFocusPainted(false);
        jPanel1.add(jCheckBox14);
        jCheckBox14.setBounds(370, 400, 280, 21);

        jCheckBox16.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox16.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox16.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox16.setFocusPainted(false);
        jPanel1.add(jCheckBox16);
        jCheckBox16.setBounds(370, 450, 280, 21);

        jCheckBox15.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox15.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox15.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox15.setFocusPainted(false);
        jPanel1.add(jCheckBox15);
        jCheckBox15.setBounds(80, 450, 270, 21);

        jCheckBox18.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox18.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox18.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox18.setFocusPainted(false);
        jPanel1.add(jCheckBox18);
        jCheckBox18.setBounds(370, 500, 280, 21);

        jCheckBox17.setBackground(new java.awt.Color(0, 0, 0));
        jCheckBox17.setFont(new java.awt.Font("Comic Sans MS", 2, 18)); // NOI18N
        jCheckBox17.setForeground(new java.awt.Color(255, 255, 255));
        jCheckBox17.setFocusPainted(false);
        jPanel1.add(jCheckBox17);
        jCheckBox17.setBounds(80, 500, 270, 21);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/OKlay1.jpg"))); // NOI18N
        jLabel1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel1MouseClicked(evt);
            }
        });
        jPanel1.add(jLabel1);
        jLabel1.setBounds(560, 550, 70, 50);

        jLabel2.setFont(new java.awt.Font("Comic Sans MS", 0, 18)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Quais professores estarão disponíveis em uma 10º aula?");
        jPanel1.add(jLabel2);
        jLabel2.setBounds(60, 30, 500, 30);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 690, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 613, Short.MAX_VALUE)
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-706)/2, (screenSize.height-651)/2, 706, 651);
    }// </editor-fold>//GEN-END:initComponents

    private void buton_adicionar1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buton_adicionar1MouseClicked
 if(i==0){  
        dispose();
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new ADDEstagios().setVisible(true);
            }
        });
        i=1;
      }
    }//GEN-LAST:event_buton_adicionar1MouseClicked

    private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel1MouseClicked
        if(VerificaDados()){
        if(i==0){  
        if(jCheckBox1.isSelected()){
          prof.setNome(jCheckBox1.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        
            if(jCheckBox2.isSelected()){
          prof.setNome(jCheckBox2.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
            
                    if(jCheckBox3.isSelected()){
          prof.setNome(jCheckBox3.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
                            if(jCheckBox4.isSelected()){
          prof.setNome(jCheckBox4.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
      
              if(jCheckBox5.isSelected()){
          prof.setNome(jCheckBox5.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
                      if(jCheckBox6.isSelected()){
          prof.setNome(jCheckBox6.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
                              if(jCheckBox7.isSelected()){
          prof.setNome(jCheckBox7.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
                                      if(jCheckBox8.isSelected()){
          prof.setNome(jCheckBox8.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
           if(jCheckBox9.isSelected()){
          prof.setNome(jCheckBox9.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }                                
              if(jCheckBox10.isSelected()){
          prof.setNome(jCheckBox10.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }     
            if(jCheckBox11.isSelected()){
          prof.setNome(jCheckBox11.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }          
            if(jCheckBox12.isSelected()){
          prof.setNome(jCheckBox12.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
            if(jCheckBox13.isSelected()){
          prof.setNome(jCheckBox13.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
            if(jCheckBox14.isSelected()){
          prof.setNome(jCheckBox14.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
           if(jCheckBox15.isSelected()){
          prof.setNome(jCheckBox15.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
            if(jCheckBox16.isSelected()){
          prof.setNome(jCheckBox16.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
             if(jCheckBox17.isSelected()){
          prof.setNome(jCheckBox17.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
                     if(jCheckBox18.isSelected()){
          prof.setNome(jCheckBox18.getText());
          int id= profmet.BuscaId(prof);
          profdias.setId_prof(id);
          profdias.setId_dias(1);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
         profdias.setId_prof(id);
          profdias.setId_dias(2);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(3);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(4);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            profdias.setId_prof(id);
          profdias.setId_dias(5);
          profdias.setId_aula(10);
            try {
                profdiasmet.Adicionar(profdias);
            } catch (SQLException ex) {
                Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
                     dispose();
                     java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new Aguarde().setVisible(true);
            }
        });
                     i=1;
      }
        }else{
            JOptionPane.showMessageDialog(rootPane, "Selecione no mínimo 5 professores");
        }
    }//GEN-LAST:event_jLabel1MouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(aula10.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(aula10.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(aula10.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(aula10.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new aula10().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel buton_adicionar1;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JCheckBox jCheckBox10;
    private javax.swing.JCheckBox jCheckBox11;
    private javax.swing.JCheckBox jCheckBox12;
    private javax.swing.JCheckBox jCheckBox13;
    private javax.swing.JCheckBox jCheckBox14;
    private javax.swing.JCheckBox jCheckBox15;
    private javax.swing.JCheckBox jCheckBox16;
    private javax.swing.JCheckBox jCheckBox17;
    private javax.swing.JCheckBox jCheckBox18;
    private javax.swing.JCheckBox jCheckBox2;
    private javax.swing.JCheckBox jCheckBox3;
    private javax.swing.JCheckBox jCheckBox4;
    private javax.swing.JCheckBox jCheckBox5;
    private javax.swing.JCheckBox jCheckBox6;
    private javax.swing.JCheckBox jCheckBox7;
    private javax.swing.JCheckBox jCheckBox8;
    private javax.swing.JCheckBox jCheckBox9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JSeparator jSeparator1;
    // End of variables declaration//GEN-END:variables

    private void AddNomeProf() {
        String[] a,b,c,d,e,f,g,h;
        
         a=EstagiosTabela.getEstagioA();
         b=EstagiosTabela.getEstagioB();
         c=EstagiosTabela.getEstagioC();
         d=EstagiosTabela.getEstagioD();
         e=EstagiosTabela.getEstagioE();
         f=EstagiosTabela.getEstagioF();
         g=EstagiosTabela.getEstagioG();
         h=EstagiosTabela.getEstagioH();
        if("Tarde".equals(a[1])){
          a[2]=""; 
        }
        if("Tarde".equals(b[1])){
          b[2]=""; 
        }
        if("Tarde".equals(c[1])){
          c[2]=""; 
        }
        if("Tarde".equals(c[1])){
          d[2]=""; 
        }
        if("Tarde".equals(c[1])){
          e[2]=""; 
        }
        if("Tarde".equals(c[1])){
          f[2]=""; 
        }
        if("Tarde".equals(c[1])){
          g[2]=""; 
        }
        if("Tarde".equals(c[1])){
          h[2]=""; 
        }
        List Nomes = null;
        
        try {
                     Nomes= profdiscmet.BuscarDisciplinasProf(a[2],b[2],c[2],d[2],e[2],f[2],g[2],h[2]);
                } catch (SQLException ex) {
                    Logger.getLogger(aula10.class.getName()).log(Level.SEVERE, null, ex);
                }
        if(!Nomes.isEmpty()){
 String[] obj = new String[20];
for(int asd=0;Nomes.size()>asd;asd++){
    obj[asd]=Nomes.get(asd).toString();
    
}
if(obj[0]!=null){
    jCheckBox1.setText(obj[0]);
}
if(obj[1]!=null){
    jCheckBox2.setText(obj[1]);
}
if(obj[2]!=null){
    jCheckBox3.setText(obj[2]);
}
if(obj[3]!=null){
    jCheckBox4.setText(obj[3]);
}
if(obj[4]!=null){
    jCheckBox5.setText(obj[4]);
}
if(obj[5]!=null){
    jCheckBox6.setText(obj[5]);
}
if(obj[6]!=null){
    jCheckBox7.setText(obj[6]);
}
if(obj[7]!=null){
    jCheckBox8.setText(obj[7]);
}
if(obj[8]!=null){
    jCheckBox9.setText(obj[8]);
}
if(obj[9]!=null){
    jCheckBox10.setText(obj[9]);
}
if(obj[10]!=null){
    jCheckBox11.setText(obj[10]);
}if(obj[11]!=null){
    jCheckBox12.setText(obj[11]);
}
if(obj[12]!=null){
    jCheckBox13.setText(obj[12]);
}
if(obj[13]!=null){
    jCheckBox14.setText(obj[13]);
}
if(obj[14]!=null){
    jCheckBox15.setText(obj[14]);
}
if(obj[15]!=null){
    jCheckBox16.setText(obj[15]);
}
if(obj[16]!=null){
    jCheckBox17.setText(obj[16]);
}
if(obj[17]!=null){
    jCheckBox18.setText(obj[17]);
}


        }else{
            System.out.println("lista vazia");
        } 
if("".equals(jCheckBox1.getText())){
    jCheckBox1.setVisible(false);
}
if("".equals(jCheckBox2.getText())){
    jCheckBox2.setVisible(false);
}
if("".equals(jCheckBox3.getText())){
    jCheckBox3.setVisible(false);
}
if("".equals(jCheckBox4.getText())){
    jCheckBox4.setVisible(false);
}
if("".equals(jCheckBox5.getText())){
    jCheckBox5.setVisible(false);
}
if("".equals(jCheckBox6.getText())){
    jCheckBox6.setVisible(false);
}
if("".equals(jCheckBox7.getText())){
    jCheckBox7.setVisible(false);
}
if("".equals(jCheckBox8.getText())){
    jCheckBox8.setVisible(false);
}
if("".equals(jCheckBox9.getText())){
    jCheckBox9.setVisible(false);
}
if("".equals(jCheckBox10.getText())){
    jCheckBox10.setVisible(false);
}
if("".equals(jCheckBox11.getText())){
    jCheckBox11.setVisible(false);
}
if("".equals(jCheckBox12.getText())){
    jCheckBox12.setVisible(false);
}
if("".equals(jCheckBox13.getText())){
    jCheckBox13.setVisible(false);
}
if("".equals(jCheckBox14.getText())){
    jCheckBox14.setVisible(false);
}
if("".equals(jCheckBox15.getText())){
    jCheckBox15.setVisible(false);
}
if("".equals(jCheckBox16.getText())){
    jCheckBox16.setVisible(false);
}
if("".equals(jCheckBox17.getText())){
    jCheckBox17.setVisible(false);
}
if("".equals(jCheckBox18.getText())){
    jCheckBox18.setVisible(false);
}
    }

    private boolean VerificaDados() {
        int j=0;
        if(jCheckBox1.isSelected()){
            j++;
        }
        if(jCheckBox2.isSelected()){
            j++;
        }
        if(jCheckBox3.isSelected()){
            j++;
        }
        if(jCheckBox4.isSelected()){
            j++;
        }
        if(jCheckBox5.isSelected()){
            j++;
        }
        if(jCheckBox6.isSelected()){
            j++;
        }
        if(jCheckBox7.isSelected()){
            j++;
        }
        if(jCheckBox8.isSelected()){
            j++;
        }
        if(jCheckBox9.isSelected()){
            j++;
        }
        if(jCheckBox10.isSelected()){
            j++;
        }
        if(jCheckBox11.isSelected()){
            j++;
        }
        if(jCheckBox12.isSelected()){
            j++;
        }
        if(jCheckBox13.isSelected()){
            j++;
        }
        if(jCheckBox14.isSelected()){
            j++;
        }
        if(jCheckBox15.isSelected()){
            j++;
        }
        if(jCheckBox16.isSelected()){
            j++;
        }
        if(jCheckBox17.isSelected()){
            j++;
        }
        if(jCheckBox18.isSelected()){
            j++;
        }
        if(j>=5){
            return true;
        }else{
            return false;
        }
    }
}
